package com.five.controller.backstage;

import com.five.dao.backstage.ChangeRoomDao;
import com.five.dao.backstage.RuZhuDetaDao;
import com.five.entity.backstage.RuZhuDetail;
import com.five.entity.backstage.TChangeRoom;
import com.five.util.LayTable;
import com.five.util.TransBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;
import java.util.Map;

@Controller
public class ChangeRoomController {
    @Autowired
    private ChangeRoomDao changeRoomDao;
    @RequestMapping("queryChangeRoom")
    @ResponseBody
    public LayTable queryChangeRoom(Integer page, Integer limit, TChangeRoom tChangeRoom){
        List<Map> maps = changeRoomDao.queryChangeRoom(page, limit, tChangeRoom);
        int count = changeRoomDao.count(tChangeRoom);
        List populate = TransBean.populate(TChangeRoom.class, maps);
        LayTable layTable = new LayTable(count, populate);
        return layTable;
    }
}
